﻿package cn.esale.dao.hibimpl;

import java.io.Serializable;
import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import cn.esale.dao.CommonDAO;

public class CommonDAOHibImpl extends HibernateDaoSupport implements CommonDAO {
	
	public Serializable add(Object o){
		Serializable ret = super.getHibernateTemplate().save(o);
		return ret;
	}
	
	public Object get(Class clazz, Serializable id){
		Object ret = super.getHibernateTemplate().get(clazz, id);
		return ret;
	}
	
	public void del(Class clazz,Serializable id){
		super.getHibernateTemplate().delete(this.get(clazz, id));
	}
	
	public void update(Object o){
		super.getHibernateTemplate().update(o);
	}
	
	public List search(String hql){
		List ret = super.getHibernateTemplate().find(hql);
		return ret;
	}
}
